package com.vip.common.config;

import io.minio.MinioClient;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author ASUS
 * @Date 2025/3/28 11:56
 * @Descripition TODO
 */
@Configuration
@Setter
@Getter
@ConfigurationProperties(prefix = "minio")
public class MinioConfig {
    /*
     * minio配置
     */
    private String endpoint;
    /*
     * minio配置
     */
    private String accessKey;
    /*
     * minio配置
     */
    private String secretKey;
    /*
     * minio配置
     */
    private String bucketName;
    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder()
                .endpoint(endpoint)
                .credentials(accessKey, secretKey)
                .build();
    }
}
